package eo.descriptor.property;

import eo.descriptor.entity.EntityDescriptor;

/**
 * Describes an association between two entites.
 * 
 * @author takeshi
 * 
 */
public interface AssociationPropertyDescriptor extends PropertyDescriptor {
    /**
     * Gets the {@link EntityDescriptor} that represents the other side of this
     * property.
     * 
     * @return {@link EntityDescriptor}
     */
    EntityDescriptor getAssociatedDescriptor();

    /**
     * Returns wheter or not the side that contains this property is the owner
     * of this relationship. Returns <code>true</code> if the relationship is
     * not bidirecional as well.
     */
    boolean isOwner();

    /**
     * On bidirecional associations, returns <code>true</code> if the side
     * that contains this property is the 'owned' side, that is, the other side
     * is the owner. On unidirecional associations, its return value is
     * <code>false</code>.
     */
    boolean isInverse();

    /**
     * Returns wheter or not this relationship is bidirecional.
     */
    boolean isBidirecional();
}
